// File Name: rs485_ctrl.h
// Author: kukukukuku~
// Date: 2024-12-20

#ifndef __RS485_CTRL_H
#define __RS485_CTRL_H

#include "apm32f00x.h"
#include "./RS485/inc/rs485_macros.h"

//RS485模式
typedef enum RS485_MODE_T
{
    RS485_MODE_RECEIVE,
    RS485_MODE_SEND,
}RS485_MODE_T;

uint16_t rs485_crc16_modbus_calc(const uint8_t * const data, const uint16_t dataLen);

void rs485_usart_send_data(const uint8_t * const data, const uint16_t dataLen);
uint8_t rs485_usart_receive_data(void);

void rs485_set_mode(const RS485_MODE_T mode);

#endif //__RS485_CTRL_H
